
import http from '@/utils/http';
import { personnel as person } from '@/apis/index';
import {cookie} from  "@/utils/index"

const PERSON_INFO = 'personnel/personinfo'
const ENTRY_INFO = 'personnel/entryinfo'
const EMPLOYEE_LIST = 'personnel/employeelist'
const EMPLOYEE_SHOW = 'personnel/employeeshow'
const EMPLOYEE_CREATE = 'personnel/employeecreate'

const personnel = {
    state: {

    },
    mutations: {

    },
    actions: {
        async [PERSON_INFO]({ commit }, data = {}) {
            return await http.get(person.personinfo, { data , params:{token:cookie.get("token")}})
        },
        async [ENTRY_INFO]({ commit }, data) {
            return await http.get(person.entryinfo, { data , params:{token:cookie.get("token")}})
        },
        async [EMPLOYEE_LIST]({ commit }, data) {
            return await http.get(person.employeelist, { data , params:{token:cookie.get("token")}})
        },
        async [EMPLOYEE_SHOW]({ commit }, data) {
            return await http.get(person.employeeshow, { data , params:{token:cookie.get("token")}})
        },
        async [EMPLOYEE_CREATE]({ commit }, data) {
            return await http.post(person.employeecreate, { data , params:{token:cookie.get("token")}})
        },
    },
    getters: {

    }
}


export default personnel